package com.tjetc.dao;

import com.tjetc.domain.Admin;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface AdminMapper {
    Admin getByUserNameAndPassword(@Param("username") String username,@Param("password") String password);

    @Select("select * from admin")
    List<Admin> list();

    @Insert("insert into admin (username, password, email, phone) values (#{username},#{password},#{email},#{phone})")
    int add(Admin admin);

    @Select("select * from admin where id=#{id}")
    Admin getById(int id);

    @Update("update admin set username=#{username},password=#{password},email=#{email},phone=#{phone} where id=#{id}")
    int update(Admin admin);

    @Delete("delete from admin where id=#{id}")
    int delete(int id);
}
